<template>
  <el-container class="layout-container-demo" style="height: 100vh">
    <el-aside width="200px">
      <el-scrollbar>
        <el-menu
          active-text-color="#ffd04b"
          background-color="#545c64"
          class="el-menu-vertical-demo"
          default-active="/home"
          text-color="#fff"
          :router="true"
        >
          <el-menu-item index="/home">
            <el-icon><Grid /></el-icon>
            <span>首页-工作台</span>
          </el-menu-item>
          <el-sub-menu index="2">
            <template #title>
              <el-icon><icon-menu /></el-icon>
              <span>管理员选项</span>
            </template>
            <el-menu-item index="/user">
              <el-icon><List /></el-icon>
              <span>管理员列表</span>
            </el-menu-item>
            <el-menu-item index="/find">
              <el-icon><Search /></el-icon>
              <span>获取管理员信息</span>
            </el-menu-item>
            <el-menu-item index="2-3">
              <el-icon><User /></el-icon>
              <span>用户列表</span>
            </el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="3">
            <template #title>
              <el-icon><Goods /></el-icon>
              <span>商品管理</span>
            </template>
            <el-menu-item index="/product">商品列表</el-menu-item>
            <el-menu-item index="3-2">商品信息</el-menu-item>
            <el-menu-item index="3-3">商品库存</el-menu-item>
          </el-sub-menu>
        </el-menu>
      </el-scrollbar>
    </el-aside>

    <el-container class="box">
      <el-header style="text-align: right; font-size: 12px">
        <!-- <template #default>
          <el-page-header :icon="null">
            <template #content>
              <span class="text-large font-600 mr-3">千峰后台管理系统</span>
            </template>
          </el-page-header>
        </template> -->

        <div class="toolbar">
          <el-dropdown>
            <el-icon style="margin-right: 8px; margin-top: 1px">
              <setting />
            </el-icon>
            <!-- <template #dropdown>
              <el-dropdown-menu>
                <el-dropdown-item>View</el-dropdown-item>
                <el-dropdown-item>Add</el-dropdown-item>
                <el-dropdown-item>Delete</el-dropdown-item>
              </el-dropdown-menu>
            </template> -->
          </el-dropdown>
          <span>rookievw</span>
        </div>
      </el-header>

      <el-main>
        <el-scrollbar>
          <router-view> </router-view>
        </el-scrollbar>
      </el-main>
    </el-container>
  </el-container>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { Menu as IconMenu, Message, Setting } from '@element-plus/icons-vue'

const item = {
  date: '2016-05-02',
  name: 'Tom',
  address: 'No. 189, Grove St, Los Angeles'
}
const tableData = ref(Array.from({ length: 20 }).fill(item))
</script>

<style scoped>
.layout-container-demo > .box {
  min-width: 615px;
}
.layout-container-demo .el-header {
  position: relative;
  background-color: white;
  color: var(--el-text-color-primary);
  border-bottom: 1px solid gray;
}
.layout-container-demo .el-aside {
  color: var(--el-text-color-primary);
  background: #545c64;
  height: 100vh;
}
.layout-container-demo .el-menu {
  border-right: none;
}
.layout-container-demo .el-main {
  padding: 10px;
  flex: 1;
  /* display: flex;
  justify-content: center; */
}
.layout-container-demo .toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  right: 20px;
}
</style>
